package com.spj.redis;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Service;

import javax.xml.crypto.Data;
import java.util.Date;

/**
 * @author :spj
 * @Date:2022/4/19
 * @description:
 */
@Configuration
public class RedisAnnotationTest {
    @Cacheable(value="myCache")// 使用了一个缓存名叫 myCache
    public String demo(String myKey) {
        Date data=new Date();
        return "旧时间:"+data.toString();
    }
}
